Beginning PHP: Master the latest features of PHP 7 and fully embrace modern PHP development by David Carr & Markus Gray
Author:David Carr & Markus Gray [Carr, David]
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2018-07-30T23:00:00+00:00
Note
The $url will hold an array from the requested route in the form of /page/requested. This is how it works: When explode is run, it finds a forward slash in the requested URI, which the $_SERVER makes available.
Next, the $controller method uses a ternary operator to check if the 0 index of $url exists, otherwise the default_controller defined in the Config class is used.
The $method checks for the existence of a $url[1], otherwise it reads from the config class.
$args will get all other indexes of $url after the first 2.
$class holds the path to the controllers as set in the Config class.
What these parameters do is get the Controller, Method, and parameters from the requested URL. For instance:
http://localhost:8000/contacts/view/2
This results in:
Contacts = Contacts class.
View = View method inside the contacts class.
2 = A parameter passed to the method.
If the requested URL is http:://localhost:8000/, then no controller or method is requested, so the default controller and method will be used, as set in system\Config.php.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(27113)
Hello! Python by Anthony Briggs(25968)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(25303)
Kotlin in Action by Dmitry Jemerov(24412)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(23607)
Dependency Injection in .NET by Mark Seemann(23326)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(21961)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(20865)
Grails in Action by Glen Smith Peter Ledbrook(19880)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(17076)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(16842)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(14472)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(12592)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(11875)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10654)
Hit Refresh by Satya Nadella(9242)
The Kubernetes Operator Framework Book by Michael Dame(8591)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8449)
Robo-Advisor with Python by Aki Ranin(8392)